<?

if (isset ($_GET['nome'])){
//var_dump($_GET['nome']);

$PROJECT_DIR = $_SERVER['DOCUMENT_ROOT'] . '/MARKET-HOME/';
require_once $PROJECT_DIR . '/Negocios/Cliente.php';
require_once $PROJECT_DIR . '/Negocios/Endereco.php';

$cliente = new Cliente();
$endereco = new Endereco();


$cliente->setNome($_GET['nome']);
$cliente->setSenha($_GET['senha']);
$cliente->setTipo($_GET['tipoPessoa']);
$cliente->setCpfcnpj($_GET['cpfcnpj']);
$cliente->setTelefone($_GET['telefone']);
$cliente->setSexo($_GET['cb']);
$endereco->setRua($_GET['rua']);
$endereco->setBairro($_GET['bairro']);
$endereco->setCep($_GET['cep']);
$endereco->setEstado($_GET['estado']);
$endereco->setCidade($_GET['cidade']);

$cliente->save($cliente, $endereco);

}
?>


<html>
<head>
<title>Cadastramento de Funcionário</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
td img {display: block;}
.style1 {
	color: #333333;
	font-weight: bold;
}
body,td,th {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
}
.style2 {color: #E5E5E5}
.style3 {
	font-size: 11px;
	font-family: Arial, Helvetica, sans-serif;
}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
</style>
</head>

<body bgcolor="#ffffff">
<table width="349" height="149" border="0">
  <tr>
    <td width="339"><form action="" method="get">
      <table width="307" border="0">
        <tr>
          <td colspan="4" bgcolor="#E5E5E5"><div align="center"><span class="style1">Cadastramento de Cliente</span></div></td>
          </tr>
        <tr>
          <td>Nome</td>
          <td colspan="3"><input name="nome" value="" size="40"  /></td>
        </tr>
        <tr>
          <td width="53"><div align="left">Senha</div></td>
          <td colspan="3"><input name="senha" type="password" size="40"  /></td>
        </tr>
        <tr>
          <td colspan="4" bgcolor="#E5E5E5"><div align="center"><span class="style1">Dados Pessoais</span></div></td>
          </tr>
        <tr>
          <td><div align="left">Pessoa</div></td>
          <td width="96">

              <div align="left">
                <input type="radio" name="tipoPessoa" value="fisica"/>
            Física </div></td>
          <td colspan="2">

              <div align="left">
                <input type="radio" name="tipoPessoa" value="juridica"/>
            Jurídica</div></td>
        </tr>
        <tr>
          <td><div align="left">CPF/CNPJ: </div></td>
          <td colspan="3"><input name="cpfcnpj" type="text" size="40" /></td>
        </tr>
        <tr>
          <td><div align="left">Telefone</div></td>
          <td colspan="3"><input name="telefone" size="40"  /></td>
        </tr>
        <tr>
          <td><div align="left">Sexo</div></td>
          <td colspan="3"><select name="cb" id="cb">
                                      <option value="" selected>Selecione</option>
                                      <option value="masculino">Masculino</option>
                                      <option value="feminino">Feminino</option>
                                    </select></td>
        </tr>
        <tr>
          <td colspan="4" bgcolor="#E5E5E5"><div align="center"><span class="style1">Endereço</span></div></td>
          </tr>
        <tr>
          <td>Rua</td>
          <td colspan="3"><input name="rua" size="40"  /></td>
        </tr>
        <tr>
          <td>Bairro</td>
          <td colspan="3"><input name="bairro" size="40"  /></td>
        </tr>
        <tr>
          <td>CEP</td>
          <td colspan="3"><input name="cep" size="10"  /></td>
        </tr>
        <tr>
          <td>Estado</td>
          <td><input name="estado" size="10"  /></td>
          <td width="47"><div align="right">Cidade</div></td>
          <td width="93">

              <div align="right">
                <input name="cidade" size="15"  />
            </div></td>
        </tr>
        <tr>
          <td><div align="left"></div></td>
          <td colspan="3">&nbsp;</td>
        </tr>
        <tr>
          <td><div align="left"></div></td>
          <td colspan="3"><div align="right">
            <input type="submit" name="Submit" value="Cadastrar" border="gray" />
          </div></td>
        </tr>
      </table>
      <p>&nbsp;</p>
      <div align="center">
      </div>
    </form></td>
  </tr>
</table>
</body>
</html>

